package appletFour;

import java.awt.Dimension;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class OutputPanel extends JPanel{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	OverallApplet overall;
	JTextArea text;
	
	public OutputPanel(OverallApplet o){
		overall = o;
		
		this.setPreferredSize(new Dimension(600, 400));
		text = new JTextArea();
		JScrollPane scroll = new JScrollPane(text);
		scroll.setPreferredSize(new Dimension(590, 390));
		this.add(scroll);
		
		TextAreaOutputStream.getInstance(this.text);
	}
	
	public void write(String s){
		text.setText(text.getText()+"\n"+s);
	}
	
}
